package com.shoppingmall.activity.mine;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.allen.library.SuperTextView;
import com.blankj.utilcode.util.BarUtils;
import com.example.zyh.toolslib.base.BaseActivity;
import com.example.zyh.toolslib.widget.TitleBar;
import com.shoppingmall.R;
import com.shoppingmall.widget.SuccessTipsDialog;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 2020/3/14
 * 描述：充值重消币
 */
public class ChargeConsumeCoinsActivity extends BaseActivity {
    @BindView(R.id.title_bar)
    TitleBar titleBar;
    @BindView(R.id.et_charge_count)
    EditText etChargeCount;
    @BindView(R.id.rl_top)
    RelativeLayout rlTop;
    @BindView(R.id.stv_wx_pay)
    SuperTextView stvWxPay;
    @BindView(R.id.stv_ali_pay)
    SuperTextView stvAliPay;
    @BindView(R.id.tv_charge_money)
    TextView tvChargeMoney;

    @Override
    protected int initLayout() {
        return R.layout.activity_mine_charge_coins;
    }

    @Override
    protected void initView() {
        BarUtils.setNavBarLightMode(this,false);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvent() {
        titleBar.setLeftLayoutClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @OnClick({R.id.stv_wx_pay, R.id.stv_ali_pay, R.id.tv_charge_money})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.stv_wx_pay:
                stvWxPay.setRightIcon(R.drawable.ic_shopcart_checked_true);
                stvAliPay.setRightIcon(R.drawable.ic_shopcart_checked_false);
                break;
            case R.id.stv_ali_pay:
                stvWxPay.setRightIcon(R.drawable.ic_shopcart_checked_false);
                stvAliPay.setRightIcon(R.drawable.ic_shopcart_checked_true);
                break;
            case R.id.tv_charge_money:
                showSuccessDialog();
                break;
        }
    }

    private void showSuccessDialog() {
        SuccessTipsDialog.Builder builder = new SuccessTipsDialog.Builder(mContext);

        builder.setContent("充值成功").build().showPopupWindow();
    }
}
